<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
{{assign var="title" value='Mysql数据库'}}
{{assign var="app" value='tool'}}
{{assign var="act" value='mysql'}}
{{assign var="td" value='10'}}
<title>{{$title}}管理 - {{'admin|admin_site_name'|C|default:'后台管理'}}</title>
{{include file="include/base.html"}}
</head>
<body>

{{include file="include/sidebar.html"}}

<div class="body_right">
	<div id="content">
	
	<form name='search' class="router" action="index.php" method="get">
		<input type="hidden" name="app" value="{{$app}}"/>
		<input type="hidden" name="act" value="{{$act}}"/>
		<div class="search">
			  <ul class="bread">
				<li>
					主机：<input class="input-small" type="text" name="dbhost" value="{{$smarty.request.dbhost}}"/>:<input class="input-small" type="text" name="dbport" value="{{$smarty.request.dbport}}"/>
				</li>
				<li>
					用户名：<input class="input-small" type="text" name="dbuser" value="{{$smarty.request.dbuser}}" size="10"/>
				</li>
				<li>
					密码：<input class="input-small" type="password" name="dbpwd" value="{{$smarty.request.dbpwd}}"/>
				</li>
				<li>
					<select name="dbcharset" class="combox">
						<option value="">--字符集--</option>
						{{html_options output=$charset_arr values=$charset_arr selected=$smarty.request.dbcharset}}
					</select>
				</li>
				{{if $db_arr}}
				<li>
					<select name="dbname" class="combox">
						<option value="">--数据库--</option>
						{{html_options options=$db_arr selected=$smarty.request.dbname}}
					</select>
				</li>
				{{/if}}
				<li>
					<button class="btn" type="submit">连接</button>
				</li>
			  <ul>
		</div>
		{{if $smarty.request.dbname}}
		<div class="search">
		  <ul class="bread">
			<li>{{$mysql_info}}， Current database: <span style="color:green;"> {{$smarty.request.dbname}}</span></li>
		  <ul>
		</div>
		<div class="search">
		  <ul class="bread">
			<li>
				SQL：
				<textarea rows="3" cols="80" name="query">{{$smarty.get.query}}</textarea>
				<button class="btn" value="12" type="submit" name="queryBtn">执行</button>
			</li>
		  <ul>
		</div>
		{{/if}}
	</form>

	<form name='form' action="index.php?app={{$app}}" method="post">
	<input type="hidden" name="app" value="{{$app}}"/>
	<input type="hidden" name="act" value=""/>
	<input type="hidden" name="table" value="{{$table}}"/>
	{{if $smarty.request.go eq "record"}}
		<!-- 数据表记录显示 -->
		{{include file="Tool/mysql_record.html"}}
	{{elseif $smarty.request.go eq "query"}}
		<!-- 执行SQL信息显示 -->
		{{include file="Tool/mysql_query.html"}}
	{{elseif $smarty.request.dbname neq ""}}
		<!-- 表信息显示 -->
		{{include file="Tool/mysql_table.html"}}
	{{/if}}
	</form>
</div>
</div>

</body>
</html>